<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Title</title>
	<link rel="stylesheet" href="/js/layui/css/layui.css" media="all">
	<link rel="stylesheet" href="/css/common.css" media="all">
	<script src="/js/layui/layui.all.js"></script>
	<script src="/admin/js/token.js"></script>
	<script src="../viewstyle/config/config2.js"></script>
</head>
<body>

<div class="layui-fluid">
	<div class="layui-card">
		<div class="layui-form layui-card-header layuiadmin-card-header-auto">
			<div class="layui-form-item">


				<div class="layui-inline">
					<div class="layui-form">
						<div class="layui-form-item">
							<label class="layui-form-label" style="margin-top: 8px;">开始时间</label>
							<div class="layui-inline">
								<input type="text" class="layui-input kuan" id="starttime" placeholder="左下角选择时间可选择时分秒">
							</div>
						</div>
					</div>
				</div>


				<div class="layui-inline">
					<div class="layui-form">
						<div class="layui-form-item">
							<label class="layui-form-label " style="margin-top: 8px;">结束时间</label>
							<div class="layui-inline">
								<input type="text" class="layui-input kuan" id="endtime" placeholder="左下角选择时间可选择时分秒">
							</div>
						</div>
					</div>
				</div>

				<div class="layui-inline">
					<button class="layui-btn layuiadmin-btn-admin" id="btnsearch" lay-submit lay-filter="LAY-user-back-search">
						<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>搜索
					</button>
				</div>
			</div>
		</div>


		<div class="layui-card-body">
			<table class="layui-hide" id="t" lay-filter="t"></table>
		</div>

	</div>
</div>


</body>

<script type="text/html" id="tb">
	<div class="layui-container">
		<button class="layui-btn layui-btn-sm" lay-event="getCheckData" onclick="getAll()">导出当前页Excel</button>
		<button class="layui-btn layui-btn-sm" lay-event="getCheckLength" onclick="getAll()">导出所有页Excel</button>
	</div>
</script>

<script type="text/html" id="caozuo">

</script>
<script>
	layui.use('laydate', function () {
		var laydate = layui.laydate

		//日期时间选择器
		laydate.render({
			elem: '#starttime'
			, type: 'datetime'
		})
		laydate.render({
			elem: '#endtime'
			, type: 'datetime'
		})
	})

	layui.use('table', function () {
		var $ = layui.$
		var table = layui.table
		var data = layui.data("stationdata");
		table.render({
			elem: '#t',
			id: 'tt',
			toolbar: '#tb',
			url: 'http://localhost:8080/admin/station-recharge/AllStationRecharge?station_recharge_station_id='+data.getdata.station_id,

			cols: [
				[{
					field: 'station_recharge_id',
					title: 'ID',
					width: '20%',
					align: 'center'
				},
					{
						field: 'station_recharge_time',
						title: '充值时间',
						width: '34%',
						align: 'center'
					},
					{
						field: 'station_recharge_sum',
						title: '充值数量',
						width: '20%',
						align: 'center'
					},
					{
						field: 'admin_name',
						title: '处理人',
						width: '25%',
						align: 'center'
					}
				]
			],
			page: true
		})
		//搜索的监听时间
		$('#btnsearch').click(function () {
			table.reload('tt', {
				where: {
					CreateTime: $("#starttime").val(),
					EndTime: $("#endtime").val()
				},
				page: {
					curr: 1
				}
			})
		})

		$(window).keypress(function (event) {
			if(event.which === 13){
				$('#btnsearch').click();
			}
		})
	})
	function getAll(){
		location="/admin/terminal/excelTerminalList";
	}
</script>
</html>
